//
//  expage1_5.c
//  denissritchie
//
//  Created by Amit Jha on 7/31/12.
//  Copyright (c) 2012 Amit Jha. All rights reserved.
//

#include <stdio.h>

/* print fahrenhite-celciuis table floating point version
 for fahr = 0, 20,.... ,300 */

int main_exer1_4(){
    float fahr , celcius;
    int lower, upper, step;
    
    lower = 0; /* lower limit of temp table*/
    upper = 300; /*upper limmit of temp table*/
    step = 20;
    
    celcius = lower;
    
    printf("%s\t%s\n", "FAHR", "CELCIUS");
    while (celcius <= upper) {
        //celcius  = (5.0/9.0) * (fahr - 32.0);
        fahr = (9.0/5.0) * celcius + 32.0;
        
        printf("%6.2f\t\t%3.0f\n", fahr, celcius);
        
        celcius = celcius + step;
    }
    return 0;
}